var ToolLayer= cc.Layer.extend({
	scene:null,
	ctor:function (parent) {
		this._super();
		this.scene = parent;
		this.scene.addChild(this, 20);
		this.init();
	},
	init: function (){
		var lib = new  ButtonScale(this,"#run/lib.png",this.callback);
		lib.setTag(TAG_BUTTON_LIB);
		lib.setPosition(cc.p(30 + lib.width*0.5, 30 + lib.height * 0.5));
		gg.buttonEnableArr.push(lib);

		//常规有tip 有lib
		this.tipItem = ll.tip.getChildByTag(TAG_TIP);
		this.tipItem.setPosition(40 + this.tipItem.width*0.5,164 + this.tipItem.height * 0.5 );

		//箭头指示
		ll.tip.arr.setVisible(true);
		if(gg.teach_type == TAG_LEAD){
			//tip步骤提示
			ll.tip.tip.setVisible(true);
		}
	},
	callback: function(pSender) {
		switch (pSender.getTag()){
		case TAG_BUTTON_LIB:
			if(ll.run.lib.isOpen()){				
				ll.run.lib.close();
				ll.tip.arr.fadein();
			} else {
				ll.run.lib.open();					
				ll.tip.arr.fadeout();
			}
		}
	}
})
